package cn.china.receiver.serviceimpl;

import cn.china.receiver.service.StudentService;
import entity.Student;
import mapper.StudentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    //StudentDao sd=new StudentDaoImpl();
    // sd.insert(student);

    @Autowired
    StudentMapper sm;

    @Override
    public int insert(Student student) {
        return sm.insert(student);
    }

    @Override
    public int insertList(List<Student> list) {
        return sm.insertList(list);
    }

    @Override
    public Student selectByPrimaryKey(Integer id) {
        return sm.selectByPrimaryKey(id);
    }

    @Override
    public List<Student> selectByName(String name) {
        return sm.selectByName(name);
    }

    @Override
    public List<Student> selectByNameAndAge(String name, Integer age) {
        return sm.selectByNameAndAge(name,age);
    }


}
